﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Company_Wait : System.Web.UI.Page
{
    protected string action = string.Empty;

    protected void Page_Load(object sender, EventArgs e)
    {

        CurrentAccount.CheckSessionTimeOut(this);
        action = (Request.QueryString["action"] ?? "").ToLower();
        //验证解密是否成功
        if (CurrentAccount.IsDecPrice) //测试用 临时去掉
        {
            HZ.Web.MessageBox.Show("解密已成功");
        }
        if (CurrentProject.InDecTime < 0)
        {
            HZ.Web.MessageBox.Show("解密时间未到，请留意公告具体解密时间！");
        }
        if (CurrentProject.InDecTime > 0)
        {
            HZ.Web.MessageBox.Show("解密时间已过");

        }
        //验证解密开关
        if (!CurrentProject.IsDecSwitch)
        {
            HZ.Web.MessageBox.Show("解密开关未开启，请留意公告具体解密时间！");
        }

        if (!IsPostBack)
        {
            SetNav();
            HZ.BidSystem.BLL.BLL_Cache.SetOnlineModel(CurrentAccount.Account.AccountId.Value, new HZ.BidSystem.Model.OnLineModel() { Active = "正在等待解密" });
        }
    }

    /// <summary>
    /// 设置导航栏
    /// </summary>
    private void SetNav()
    {
        switch (action)
        {
            case "bargain":
                CompanyNavigation1.BidType = HZ.BidSystem.Model.BidType.Bargain;
                break;

            case "compete":
                CompanyNavigation1.BidType = HZ.BidSystem.Model.BidType.Compete;
                break;
            default:
                CompanyNavigation1.BidType = HZ.BidSystem.Model.BidType.Bid;
                break;
        }
    }
}
